package com.ybkj.chat.module.main.activity;

import android.view.Gravity;
import android.view.View;
import android.widget.TextView;

import com.ybkj.chat.R;
import com.ybkj.chat.base.BaseMvpActivity;
import com.ybkj.chat.manager.ActivityManager;
import com.ybkj.chat.ui.dialog.PopSendVideo;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 附近陌生人发布视频
 */
public class SendVideoActivity extends BaseMvpActivity {


    @BindView(R.id.left_tv)
    TextView leftTv;
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.right_tv)
    TextView rightTv;
    @BindView(R.id.location_tv)
    TextView locationTv;
    @BindView(R.id.look_tv)
    TextView lookTv;

    PopSendVideo popSendVideo;
    @Override
    protected void injectPresenter() {

    }

    @Override
    protected void initTitle() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_send_video;
    }

    @Override
    protected void initView() {
        initPictureSelectDialog();
    }

    @Override
    protected void initData() {

    }

    private void initPictureSelectDialog() {
        popSendVideo = new PopSendVideo(this);
        popSendVideo.setOnItemClickListener(new PopSendVideo.OnItemClickListener() {
            @Override
            public void onItemClick(View v) {

                switch (v.getId()) {
                    case R.id.tv_cancel:
                        popSendVideo.dismiss();
                        break;

                    case R.id.tv_share:
                        popSendVideo.dismiss();
                        //mTakePhoto.onEnableCompress(mCompressConfig, true);
                        //mTakePhoto.onPickFromGallery();
                        break;

                    case R.id.forward:
                        popSendVideo.dismiss();
/*                        File file = new File(getExternalCacheDir(), System.currentTimeMillis() + ".png");
                        if (!file.getParentFile().exists())
                            file.getParentFile().mkdirs();
                        Uri imageUri = Uri.fromFile(file);
                        mTakePhoto.onEnableCompress(mCompressConfig, true);
                        mTakePhoto.onPickFromCapture(imageUri);*/
                        break;

                }
            }
        });
    }

    @OnClick({R.id.left_tv, R.id.right_tv, R.id.location_tv, R.id.look_tv, R.id.friend_share, R.id.qq_share})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.left_tv:
                finish();
                break;
            case R.id.right_tv:
                popSendVideo.showAtLocation(rightTv, Gravity.BOTTOM, 0, 0);
                popSendVideo.setBackgroundAlpha(this, 0.5f);
                break;
            case R.id.location_tv:
                ActivityManager.gotoActivity(mContext, locationActivity.class);
                break;
            case R.id.look_tv:
                ActivityManager.gotoActivity(mContext, WhoLookActivity.class);
                break;
            //微信朋友圈分析
            case R.id.friend_share:
                ActivityManager.gotoActivity(mContext, FriendGroupShareActivity.class);
                break;
            //QQ空间分析
            case R.id.qq_share:
                break;
        }
    }
}
